package com.imooc.controller;

import com.imooc.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * ClassName:HelloController Package:com.imooc.controller Description:
 *
 * @Date:2021/7/5 7:57
 * @Author:sunzheng@beiming.com
 */
@ApiIgnore
@RestController
public class StuFooController {

  @Autowired
  private StuService stuService;

  @GetMapping("/getStu")
  public Object getStu(Integer id) {
    return stuService.getStuInfo(id);
  }


  @PostMapping("/saveStu")
  public Object saveStu() {
    stuService.saveStu();
    return "ok";
  }

  @PutMapping("/updateStu")
  public Object updateStu(Integer id) {
    stuService.updateStu(id);
    return "ok";
  }


  @DeleteMapping("/deleteStu")
  public Object deleteStu(Integer id) {
    stuService.deleteStu(id);
    return "ok";
  }

}
